package com.lanou3g.srpingjpa1.controller;

import com.lanou3g.srpingjpa1.entity.RoleInfo;
import com.lanou3g.srpingjpa1.repository.RoleInfoRepository;
import org.springframework.data.rest.core.annotation.RestResource;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 创建 JYQ  on  2018/10/31,11:25
 */
@RestController
@RequestMapping(name = "/role")
public class RoleInfoController {
    @RestResource
    private RoleInfoRepository repository;

    @RequestMapping("/findByName/{name}")
    public List<RoleInfo> findByName(@PathVariable String  name){
        List<RoleInfo>  infoList = this.repository.findByNameContains(name);
return  infoList;
    }
}
